<%@page import="com.wframe.framework.util.UploadUtil"%>
<%@page import="com.wframe.project.jnd.rest.util.WebSession"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/website/common/base.jsp"%>

<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set>
<%request.setAttribute("isuserauth",WebSession.checkWbUserAuth(session));
request.setAttribute("fileserver", UploadUtil.getConfig().getDownserver());
%>
<c:forEach items="${list }" var="info" varStatus="status">
	<div class="container-bd F${status.index+1} inner mt-20 " floorid="${info.id }" itemid="">
    	<div class="cont-title">
        	<h2>${status.index+1}F ${info.name }</h2>
        	<a href="javascript:;"><label style="padding-right:10px;" onclick="morefloor(${info.id })">更多</label><label>></label></a>
        </div>
        <div class="cont-main">
        	<div class="cont-main-left">
            	<div class="cont-left-hd"><c:if test="${not empty info.floorphoto}"><a href="javascript:showInformation(${info.floorinfoid },${info.floorinfotype },'${info.floorinfourl }');"><img src="${fileserver }${info.floorphoto}"  style="width:250px;height:550px"/></a></c:if></div>
            	<ul class="cont-left-bd clearfix">
            		<c:forEach items="${info.itemlist }" var="item">
            		<li><a href="javascript:changefloorproduct(${info.id },${item.getString("id") });">${item.getString("name") }</a></li>
            		</c:forEach>
            	</ul>
                
          	</div>
        	<div class="cont-main-right">
            	<div class="cont-main-right-midline"></div>
            	<ul class="cont-right-bd" id="floor${info.id }">
            		<c:forEach items="${info.productlist }" var="item">       		
            		<li class="cont-right-item">
						<div class="cont-right-pic"><a href="${ctx }/product/info?priceid=${item.getString("id")}" target="_blank"><img src="${fileserver }${item.getString("photo")}" onerror="this.src='${ctx }/website/images/noimg.jpg'" title="${item.getString("productname")} ${item.getString("name")} ${item.getString("B_guige")}"/></a></div>
                        <div  class="cont-right-info">
                            <p class="title"><a href="${ctx }/product/info?priceid=${item.getString("id")}" target="_blank">${item.getString("productname")} ${item.getString("name")} ${item.getString("B_guige")}</a></p>
                            <%--<p class="col999 ellipsis-1">${item.getString("B_guige")}</p>--%>
                            <p class="col999 ellipsis-1">
                            <c:choose>  
							    <c:when test="${fn:length(item.getString('B_chanjia')) > 13}">  
							        <c:out value="${fn:substring(item.getString('B_chanjia'), 0, 13)}..." />  
							    </c:when>  
							   <c:otherwise>  
							      <c:out value="${item.getString('B_chanjia')}" />  
							    </c:otherwise>  
							</c:choose>
                            </p>
                            <p class="cost"><c:choose><c:when test="${islogin && isuserauth }"> <b>￥${item.get("price")}</b></c:when><c:when test="${!islogin}"><font class="red">登录可见</font></c:when><c:when test="${!isuserauth}"><font class="red">审核通过可见</font></c:when></c:choose></p>
                    	</div>
                  	</li>
            		</c:forEach>
            	</ul>
            </div>
        </div>
    </div>
</c:forEach>
<script>
	function morefloor(fid){
		window.location.href=ctx+"/product/list?floorid="+fid+"&flooritemid="+$("[floorid='"+fid+"']").attr("itemid");
	}
	
	function changefloorproduct(floorid,itemid){
		window.location.href=ctx+"/product/list?floorid="+floorid+"&flooritemid="+itemid;
	}
</script>
<script type="text/html" id="floorproducts">
	{{each list as value i}}
	<li class="cont-right-item">
		<div class="cont-right-pic"><a href="{{ctx}}/product/info?priceid={{value.id}}" target="_blank"><img src="{{fileserver}}{{value.photo}}" onerror="this.src='{{ctx}}/website/images/noimg.jpg'"/></a></div>
		<div  class="cont-right-info">
  			<p class="title">{{value.productname}}{{value.name}}</p>
  			<p class="col999">{{value.b_guige}}</p>
  			<p class="col999">{{value.b_chanjia}}</p>
  			<p class="cost">{{if isuserauth}} <b>￥{{value.price}}</b>{{/if}}</p>
		</div>
	</li>
	{{/each}}
</script>